/**
 * Demo.java is created by Zachariah at 2012-1-19 下午05:08:06
 */
package com.zack.designPattern.decorator;

/**
 * @author zachariah zzcfrog@gmail.com
 *
 */
public class Demo {

	public static void main(String args[]){
		Beverage beverage = new Water();
		beverage = new Chocolate().addedTo(beverage);
		beverage = new Milk().addedTo(beverage);
		
		System.out.println(beverage.cost());
		
		Beverage beverage2 = new Milk(new Chocolate(new Water()));
		System.out.println(beverage2.cost());
	}
	
}
